package com.frxuexi.mdm2204.view

import androidx.compose.foundation.Image
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.viewinterop.AndroidView
import androidx.navigation.NavHostController
import com.frxuexi.mdm2204.R
import com.frxuexi.mdm2204.myview.MyProgressView
lateinit var progressView: MyProgressView
//@Preview
@Composable
fun WelcomePage(navHostController:NavHostController) {
    Column(Modifier.fillMaxSize(),horizontalAlignment = Alignment.CenterHorizontally) {
        AndroidView(factory = {
            progressView= MyProgressView(it,navHostController)
            progressView.start()
            progressView
        })
        Spacer(modifier = Modifier.height(100.dp))
        Image(painter = painterResource(id = R.drawable.img), contentDescription ="" )
        Spacer(modifier = Modifier.height(10.dp))
        Text(text = "MDM")
    }
}